package com.yunxin.zm.controller;


import com.yunxin.basis.controller.BasisController;
import com.yunxin.common.utils.ResponseResult;
import com.yunxin.zm.domain.ChapterTableEntity;
import com.yunxin.zm.domain.dto.ChapterContentTableDTO;
import com.yunxin.zm.domain.dto.ChapterTableDTO;
import com.yunxin.zm.domain.query.ChapterTableQuery;
import com.yunxin.zm.domain.save.ChapterTableSave;
import com.yunxin.zm.service.IChapterTableService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * @author hjl
 * @date Mon Mar 03 09:14:13 CST 2025
 */
@RestController
@RequestMapping("/chapterTable")
public class ChapterTableController extends BasisController<ChapterTableEntity, ChapterTableDTO, ChapterTableSave, ChapterTableQuery,IChapterTableService>
{
    public ChapterTableController(IChapterTableService service) {
        super(service);
    }

    @GetMapping("/chapterList/{bid}")
    public ResponseResult<List<ChapterTableDTO>> chapterList(@PathVariable(value = "bid")Long bid){
        return ResponseResult.success(service.chapterList(bid));
    }

    @GetMapping("/chapterDetail/{cid}")
    public ResponseResult<ChapterContentTableDTO> chapterDetail(@PathVariable(value = "cid")Long cid){
        return ResponseResult.success(service.chapterDetail(cid));
    }
}
